<?php
/*  
  Copyright (c) 2010-02 SongCMS 
  SongCMS All Rights Reserved. 
  Support:www.SongCMS.com
  QQ:544255858   19951025
  Author:Song  Version:3.17
  Date:2010-08-12 09:28:32
*/

include_once('Admin.php');
if(!empty($_POST['Code'])){
	$Top = is_numeric(trim($_POST['Top'])) ? trim($_POST['Top']) : 0;
	$Level = is_numeric(trim($_POST['Level'])) ? trim($_POST['Level']) : 0;
	$Code = "'".str_replace("\r\n",'',trim($_POST['Code']))."'";
	$xJS = "var Communication = new Array(); \r\n";
	$xJS .= "Communication['isOpen'] = {$_POST['isOpen']};\r\n";
	$xJS .= "Communication['Align'] = {$_POST['Align']};\r\n";
	$xJS .= "Communication['Top'] = {$Top};\r\n";
	$xJS .= "Communication['Level'] = {$Level};\r\n";
	$xJS .= "Communication['Code'] = {$Code};";
	if(@file_put_contents("../config/communication.php",$xJS)){
		AdminLog(1,$Lang,'修改浮动客服管理，结果：操作成功！'); 
		MsgBox (1,"客服管理修改成功。",1);
	} else {
		AdminLog(1,$Lang,'修改浮动客服管理，结果：操作失败！'); 
		MsgBox (1,"修改失败，无法写入文件： ../config/communication.php",'1');
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="./images/adminstyle.css" rel="stylesheet" type="text/css" />
<link rel="Shortcut Icon" href="../favicon.ico">
<link rel="Bookmark" href="../favicon.ico">
<script src="../js/csshovernotie6.js" type="text/javascript"></script>
<script src="../config/communication.php" type="text/javascript"></script>
<script type="text/javascript">
window.onload = function(){
	if(Communication['isOpen'] == 0){
		document.getElementById('isOpen0').checked = "checked";	
	} else if(Communication['isOpen'] == 1) {
		document.getElementById('isOpen1').checked = "checked";	
	} else {
		document.getElementById('isOpen2').checked = "checked";	
	}
	if(Communication['Align'] == 0){
		document.getElementById('Align0').checked = "checked";		
	} else {
		document.getElementById('Align1').checked = "checked";		
	}
	document.getElementById('Top').value = Communication['Top'];
	document.getElementById('Level').value = Communication['Level'];
	document.getElementById('Code').value = Communication['Code'];
};
</script>
</head>
<body>
<br />
<table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
  <form id="form1" name="form1" method="post" action="CommunicationManage.php">
  <tr>
    <td colspan="3" align="center" class="Main_Title">浮动客服管理</td>
  </tr>
  <tr class="odd">
  	<td height="20" align="right">显示方式：</td>
  	<td>
  		<input type="radio" name="isOpen" id="isOpen0" value="0" />关闭浮动客服 &nbsp;
  		<input type="radio" name="isOpen" id="isOpen1" value="1" />自动收缩 &nbsp;
  		<input name="isOpen" type="radio" id="isOpen2" value="2" />永久显示 
  	</td>
  	<td>关闭后将不在任何页面显示</td>
  	</tr>
  <tr class="odd">
  	<td height="20" align="right">浮动位置：</td>
  	<td>
		<input type="radio" name="Align" id="Align0" value="0" />屏幕左侧浮动 &nbsp;
		<input type="radio" name="Align" id="Align1" value="1" />屏幕右侧浮动
	</td>
  	<td>&nbsp;</td>
  	</tr>
  <tr class="odd">
  	<td height="20" align="right">顶部距离：</td>
  	<td><input name="Top" type="text" id="Top" size="5" maxlength="4" /> Px</td>
  	<td>浮动客服离屏幕上方的距离</td>
  	</tr>
  <tr class="odd">
  	<td height="20" align="right">侧边距离：</td>
  	<td><input name="Level" type="text" id="Level" size="5" maxlength="4" /> Px</td>
  	<td>浮动客服离屏幕左或右之间的距离</td>
  	</tr>
  <tr class="odd">
    <td height="20" align="right">互动代码：</td>
    <td><textarea name="Code" id="Code" style="width:550px; height:200px;"></textarea></td>
    <td style="line-height:22px;">
		支持HTML语法，输入的内容将在侧面浮动框中显示<br />
		<strong>您可以登录相关网站获取您的即时沟通代码</strong>：<br />
		<a target="_blank" href="http://wp.qq.com/">获取腾讯QQ即时沟通互动代码</a><br />
		<a target="_blank" href="http://settings.messenger.live.com/applications/websettings.aspx">获取MSN在线沟通互动代码</a><br />
		<a target="_blank" href="http://club.china.alibaba.com/club/block/alitalk/alitalkfire.html">获取阿里巴巴贸易通互动代码</a><br />
		<a target="_blank" href="http://www.skype.com/share/buttons/">获取skype在线状态互动代码</a>
	</td>
  </tr>
  <tr class="odd">
    <td height="20" align="right">&nbsp;</td>
    <td><input type="submit" name="button" id="button" value="提 交" class="submit" /></td>
    <td>&nbsp;</td>
  </tr>
  </form>
</table>
</body>
</html>
